<h1>Listing pages</h1>

<table>
  <tr>
    <th>Page number</th>
    <th>Book</th>
  </tr>

<% @pages.each do |page| %>
  <tr>
    <td><%=h page.page_number %></td>
    <td><%=h page.book %></td>
    <td><%= link_to 'Show', book_page_path(page.book, page) %></td>
    <td><%= link_to 'Edit', edit_book_page_path(page.book, page) %></td>
    <td><%= link_to 'Destroy', book_page_path(page.book, page), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New page', new_book_page_path(@book) %>